package com.wzl.Day23;

/**
 * 生产者消费者模型
 */
public class Day23 {

    public static boolean isAnagram(String s, String t) {
        if(s.length() != t.length())
            return false;
        int[] flag = new int[26];
        for(int i = 0; i< s.length(); i++) {
            flag[s.charAt(i) - 'a'] ++;
            flag[t.charAt(i) - 'a'] --;
        }
        for(int i=0;i<26;i++)
            if(flag[i] != 0)
                return false;
        return true;
    }
    public static void main(String[] args) {
        int i = 199;
        Integer j = 199;
        Integer p = 199;
        System.out.println(i == j);
        System.out.println(i == p);
        System.out.println(j == p);
        String  s1 = "auyed";
        String  s2 = "ayued";
        boolean anagram = isAnagram(s1, s2);

    }
}
